package com.ruoyi.tws.controller.app;

import com.ruoyi.common.core.constant.Constants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.tws.domain.OrderTrail;
import com.ruoyi.tws.service.IOrderTrailService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 手机端 - 订单手机定位轨迹controller
 */
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping(Constants.APP_URL + "/")
public class AppOrderTrailController {

    private final IOrderTrailService orderTrailService;

    /**
     * 新增订单手机定位轨迹
     * @param orderTrail
     * @return
     */
    @PostMapping("orderTrail-add")
    public R add(@RequestBody OrderTrail orderTrail) {
        return orderTrailService.save(orderTrail) ? R.ok(): R.fail();
    }

}
